package org.OpenGeoPortal.SiteCustomizable;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import com.google.inject.Guice;
import com.google.inject.Injector;

public class TomcatContextListener 
{
	public void contextDestroyed(ServletContextEvent arg0)
	{
	}

	public static final String Key = Injector.class.getName();
	public void contextInitialized(ServletContextEvent contextEvent)
	{
		System.out.println("in contextInitialized");
		contextEvent.getServletContext().setAttribute("theInjector", getInjector());
	}

	private Injector getInjector()
	{
		Injector injector = Guice.createInjector(new GuiceConfig());
		return injector;
	}
	
	

}
